﻿namespace UnityEngine
{
    using System;
    using System.Runtime.CompilerServices;
    using System.Runtime.InteropServices;

    public sealed class Font : UnityEngine.Object
    {
        private event FontTextureRebuildCallback m_FontTextureRebuildCallback;

        public bool GetCharacterInfo(char ch, out CharacterInfo info)
        {
            FontStyle normal = FontStyle.Normal;
            int size = 0;
            return this.GetCharacterInfo(ch, out info, size, normal);
        }

        public bool GetCharacterInfo(char ch, out CharacterInfo info, int size)
        {
            FontStyle normal = FontStyle.Normal;
            return this.GetCharacterInfo(ch, out info, size, normal);
        }

        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public extern bool GetCharacterInfo(char ch, out CharacterInfo info, int size, FontStyle style);
        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public extern bool HasCharacter(char c);
        private void InvokeFontTextureRebuildCallback_Internal()
        {
            if (this.m_FontTextureRebuildCallback != null)
            {
                this.m_FontTextureRebuildCallback();
            }
        }

        public void RequestCharactersInTexture(string characters)
        {
            FontStyle normal = FontStyle.Normal;
            int size = 0;
            this.RequestCharactersInTexture(characters, size, normal);
        }

        public void RequestCharactersInTexture(string characters, int size)
        {
            FontStyle normal = FontStyle.Normal;
            this.RequestCharactersInTexture(characters, size, normal);
        }

        [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall]
        public extern void RequestCharactersInTexture(string characters, int size, FontStyle style);

        public CharacterInfo[] characterInfo { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] get; [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] set; }

        public string[] fontNames { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] get; [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] set; }

        public Material material { [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] get; [MethodImpl(MethodImplOptions.InternalCall), WrapperlessIcall] set; }

        public FontTextureRebuildCallback textureRebuildCallback
        {
            get
            {
                return this.m_FontTextureRebuildCallback;
            }
            set
            {
                this.m_FontTextureRebuildCallback = value;
            }
        }

        public delegate void FontTextureRebuildCallback();
    }
}

